package com.dyh.quickdemozwei.beanOrder;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
//@Configuration
public class Bconfig {

    @Bean
    public B b(){
        StackTraceElement[] traceElements =  Thread.currentThread().getStackTrace();
        /*0 是 Thread.currentThread().getStackTrace()
         * 1 是 com.dyh.quickdemozwei.beanOrder.BeanOrderConfig.b
         * */
        StackTraceElement caller = traceElements[2];
        log.info("初始化B 调用者 {}#{}",caller.getClassName(),caller.getMethodName());
        return new B();
    }
}
